package projekt.algorytmy;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import watki.ManagerWatkow;

@RunWith(Parameterized.class)
public class TestSzablon {
	protected ArrayList<Integer> expected = new ArrayList<Integer>();
	protected String tekst;
	protected String wzorzec;
	protected  ManagerWatkow man = ManagerWatkow.manager();
	
	@Parameters
	public static Collection<Object[]> data(){
		
		Object[][]  data = { {"a","aaaa"},  
				{"BABBB","AABABBBBABBBBABABAAABBBAABBBABABBABABBAABABBBBBAABAAAAAAABABBBABBBABAABBBBAAAABB"},
		{"your","This is the end Hold your breath and count to ten Feel the earth move and then Hear my heart burst again"},
		{"aaaa","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},
		{"AaA","aaa"},
		{"a","a"},
		{"aa","a"},
		{"abc","dsadaswqeabc"}
		};
		return Arrays.asList(data);
	}
	
	public TestSzablon(String wzorzec,String tekst){
		int start = tekst.indexOf(wzorzec);
		this.wzorzec = wzorzec;
		this.tekst = tekst;
		while(start != -1){
			expected.add(start);
			start = tekst.indexOf(wzorzec, start + 1);
		}
	}
	
}
